home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / cxref.exe / CXREF.DOC < prev    next >
Encoding:
Text File  |  1992-02-24  |  19.6 KB  |  537 lines

  1.  
  2.  
  3.  
  4.  
  5.                   C xref - C language cross-reference utility. v2.0
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                                        C xref
  24.                        The C language cross reference utility.
  25.                             (c) 1992 by David Archibald.
  26.  
  27.  
  28.  
  29.                   C xref - C language cross-reference utility. v2.0
  30.  
  31.  
  32.  
  33.                                   Table of Contents
  34.  
  35.                     Introduction:
  36.                        Registration information............... 101
  37.                        System requirements.................... 102
  38.                        What C xref does....................... 103
  39.                     Program output:
  40.                        Global variables and constants......... 201
  41.                        Summary list of functions.............. 202
  42.                        Verbose list of functions.............. 203
  43.                        Function tree.......................... 204
  44.                     Running C xref:
  45.                        The command line syntax................ 301
  46.                        The module names....................... 302
  47.                        The -x command......................... 303
  48.                        The -t command......................... 304
  49.                        The -s command......................... 305
  50.                        The -w command......................... 306
  51.                        The -l command......................... 307
  52.                        The -i command......................... 308
  53.                        The -n command......................... 309
  54.                        Command line examples.................. 310
  55.                   The reserved word file: RES_WORD.TXT........ 401
  56.                   What C xref ignores......................... 501
  57.  
  58.  
  59.  
  60.                   C xref - C language cross-reference utility. v2.0
  61.  
  62.  
  63.  
  64.           101  Registration information.
  65.  
  66.                C xref is a Shareware program, and copies of this program
  67.                and it's documentation may be freely distributed.
  68.  
  69.                Note: C xref and this document are copyrighted and may not
  70.                be modified in any manner.
  71.  
  72.                Individual copies may be licensed for $20. (Site licenses
  73.                are available for commercial use. Please write for details.)
  74.  
  75.                After registering you will be sent the latest version of C
  76.                xref, and, as they become available, any future updates.
  77.  
  78.  
  79.  
  80.                   C xref - C language cross-reference utility. v2.0
  81.  
  82.  
  83.  
  84.                                      Order Form
  85.  
  86.           Registration fee                              Fee   $   20.00
  87.           (Michigan residents please add 4% sales tax)  Tax         .80
  88.  
  89.                                                         Total $ _______
  90.  
  91.               Name:___________________________________________________
  92.  
  93.               Company:________________________________________________
  94.  
  95.               Address:________________________________________________
  96.  
  97.                      :________________________________________________
  98.  
  99.                      :________________________________________________
  100.  
  101.           Disk size:
  102.                     5 1/4:_____
  103.                     3 1/2:_____
  104.  
  105.                Send to:
  106.                          DA Software
  107.                          3717 Aldon Lane
  108.                          Flint, MI 48506
  109.  
  110.           (If you have any suggestions or comments about C xref, please
  111.           include them.)
  112.  
  113.           Comments:
  114.  
  115.  
  116.  
  117.                   C xref - C language cross-reference utility. v2.0
  118.  
  119.  
  120.  
  121.           102  System requirements.
  122.  
  123.                Config.sys file:
  124.                     The "file" statement in your config.sys file must equal
  125.                     at least 20. If it doesn't, then using EDLIN, or
  126.                     another ASCII text editor, change the "file" statement
  127.                     in your config.sys file so that it reads "file=20".
  128.                Memory limits:
  129.                     There is no minimum memory, but the number of modules
  130.                     you can cross-reference is dependent on the amount of
  131.                     memory you have. If C xref runs out of memory it will
  132.                     output an error message, and terminate.
  133.  
  134.           103  What it does.
  135.  
  136.                C xref is a cross-reference utility program for the C
  137.                programming language. It will read any number of your C text
  138.                modules and send the following to standard output:
  139.  
  140.                o    A list of the module's global variables and constants,
  141.                     along with the line numbers they appear on.
  142.                o    A summary listing of module's functions.
  143.                o    A verbose list of all the module's functions that
  144.                     includes: the name of the module it originates in, line
  145.                     of origin, users, callers, and what local and global
  146.                     variables appear in the function.
  147.                o    A tree that displays all of the functions calling
  148.                     hierarchy.
  149.  
  150.                Note: Remember, you can use DOS redirection to send the
  151.                     output else where; i.e. >LPT1.
  152.  
  153.  
  154.  
  155.                   C xref - C language cross-reference utility. v2.0
  156.  
  157.  
  158.  
  159.           201  Global variables and constants.
  160.  
  161.                C xref assumes that anything declared outside a function's
  162.                boundaries (from the function name to the function's closing
  163.                brace) is a global variable or constant.
  164.  
  165.                The global variable and constant cross-reference has the
  166.                following format:
  167.  
  168.           variable name [type]
  169.                {module name}  which line numbers in this module the 
  170.                               variable appears on.
  171.  
  172.                Sample output:
  173.  
  174.                char_pnt [char]
  175.                   {example.c   }  1
  176.                   {explfile.c  }  10    11    16    28    35    42
  177.                cnt [int]
  178.                   {example.c   }  4     11    32
  179.                   {explfile.c  }  8     14
  180.  
  181.  
  182.           202  Summary list of functions.
  183.  
  184.                The summary list has the following format:
  185.  
  186.           {module name}  :  line-of-origin  :  function name() [type]
  187.  
  188.           Note: a line-of-origin of [NONE] indicates that the function was
  189.           not in any of the modules cross-referenced.
  190.  
  191.                Sample output:
  192.  
  193.                {explfile.c  }   :    32      :   is_it_a_comma() [int]
  194.                {example.c   }   :    7       :   main()  [void]
  195.                {explfile.c  }   :    39      :   not_comma()  [char]
  196.                {example.c   }   :    25      :   open_file()  [FILE]
  197.  
  198.  
  199.  
  200.                   C xref - C language cross-reference utility. v2.0
  201.  
  202.  
  203.  
  204.           203  Verbose list of functions.
  205.  
  206.                The verbose list of functions has the following format:
  207.  
  208.             function name [type]  :   {module name}  :  line-of-origin
  209.  
  210.                   USERS:
  211.                     {module name}   the line numbers in this module that
  212.                                    reference this function.
  213.  
  214.                   CALLS:
  215.                    {module name}   function name()   {module}  func1()
  216.  
  217.                   LOCAL VARIABLES:
  218.                     variable name [type]. the line numbers in this function
  219.                                          it appears on.
  220.  
  221.                   GLOBAL VARIABLES:
  222.                     variable name [type]. the line numbers in this function
  223.                                          it appears on.
  224.  
  225.  
  226.                As with the summary listing, a line-of-origin of [NONE]
  227.                indicates that a function was referenced, but did not appear
  228.                in any of the modules cross-referenced.
  229.  
  230.                USERS are the line numbers in a module that call this
  231.                function.
  232.  
  233.                CALLS are other functions that this function references.
  234.  
  235.                LOCAL VARIABLES are any variable or constant that falls
  236.                between a function's name and it's closing brace.
  237.  
  238.           Note: As with your C compiler, when a local and global variable
  239.           have the same name, the global variable is hidden and C xref
  240.           cross-references it as a local variable.
  241.  
  242.                GLOBAL VARIABLES are a list of any global variables or
  243.                constants that appear in this function.
  244.  
  245.  
  246.  
  247.                   C xref - C language cross-reference utility. v2.0
  248.  
  249.  
  250.  
  251.      Sample verbose output:
  252.  
  253. ===============================================================================
  254. main()  [void] : {example.c} : 7
  255. ===============================================================================
  256.    USERS:  [NONE]
  257. -------------------------------------------------------------------------------
  258.    CALLS:
  259.    {example.c   }          close_file()    {explfile.c  }           not_comma()
  260.    {example.c   }           get_input()    {example.c   }           open_file()
  261. -------------------------------------------------------------------------------
  262.    LOCAL VARIABLES:
  263.      argc [int]    7     10
  264.      argv [char]    7     9
  265.      column [int]    13    19
  266.      file_name [char]    12    17
  267.      file_pnt [FILE]    14    18    21
  268.      row [int]   13    19
  269. -------------------------------------------------------------------------------
  270.    GLOBAL VARIABLES:
  271.      cnt [int]
  272.         {example.c  }    11
  273.  
  274. ===============================================================================
  275. not_comma()  [char] : {explfile.c} : 39
  276. ===============================================================================
  277.    USERS:
  278.         {explfile.c  }  13
  279. -------------------------------------------------------------------------------
  280.    CALLS:  [NONE]
  281. -------------------------------------------------------------------------------
  282.    LOCAL VARIABLES:
  283.      [NONE]
  284. -------------------------------------------------------------------------------
  285.    GLOBAL VARIABLES:
  286.      char_pnt [char]
  287.         {explfile.c}    42
  288.  
  289.  
  290.  
  291.                   C xref - C language cross-reference utility. v2.0
  292.  
  293.  
  294.  
  295.           204  Function tree.
  296.  
  297.                The function tree option generates a tree representation of
  298.                all of module's function calls (or more simply stated: who's
  299.                calling who).
  300.  
  301.                The following is a sample tree for two modules:
  302.  
  303.                example.c   :main
  304.                example.c   :|_close_file
  305.                example.c   :|_output_char
  306.                example.c   :|_get_input
  307.                explfile.c  :| |_not_comma
  308.                explfile.c  :| |_is_it_a_comma
  309.                explfile.c  :|   |_is_it_a_comma*
  310.                            :|
  311.                example.c   :|_open_file
  312.  
  313.           Note: An '*' following a function name indicates that this is a
  314.           recursive function call.
  315.  
  316.  
  317.  
  318.                   C xref - C language cross-reference utility. v2.0
  319.  
  320.  
  321.  
  322.           301  The command line syntax.
  323.  
  324.                cxref [-x t i[p path;path...] n s w l] sourcefilespec1
  325.                [sourcefilespec2...]
  326.  
  327.           Note: A space must separate each command.
  328.  
  329.           302  Module names.
  330.  
  331.                C xref will accept any legal DOS file name. Standard DOS
  332.                pattern checking is supported ('?' and '*').
  333.  
  334.           Note: Upper or lower case letters can be used with any of the
  335.           following commands.
  336.  
  337.           303  The -x command.
  338.  
  339.                When the 'x' command is entered, everything except the
  340.                function tree is output.
  341.  
  342.           304  The -t command.
  343.  
  344.                With the 't' command, only the function tree is output-
  345.                -nothing else.
  346.  
  347.           305  The -s command.
  348.  
  349.                With the 's' command, only the function summary is output-
  350.                -all other output is suppressed.
  351.  
  352.           306  The -w command.
  353.  
  354.                The default line width for output is 80 characters, but with
  355.                the 'w' command you can set the line width to 132 characters
  356.                (useful if you have a wide carriage printer).
  357.  
  358.           307  The -l command.
  359.  
  360.                With the 'l' command you can add identifiers from the cross-
  361.                referenced modules to the RES_WORD.TXT file (C xref ignores
  362.                anything in a module that appears in this file. See section
  363.                401).
  364.  
  365.  
  366.  
  367.                   C xref - C language cross-reference utility. v2.0
  368.  
  369.  
  370.  
  371.                The function names and global variables will be output one
  372.                at a time. After an identifier is output you may select one
  373.                of three options:
  374.                     o    Press 'a' to add the item to the RES_WORD.TXT
  375.                          file.
  376.                     o    Press 'q' to quit and stop adding to the file.
  377.                     o    Press any other key to skip the item.
  378.  
  379.           308  The -i command.
  380.  
  381.                The 'i' command lets you to cross-reference the "include"
  382.                files in your modules. This command only cross-references
  383.                those include files that are enclosed in "<>".
  384.  
  385.                C xref keeps track of the names of include files, so that a
  386.                file is only cross-referenced once. It also cross-references
  387.                nested include files up to 15 files deep.
  388.  
  389.                Cxref always looks in the current directory (i.e. the
  390.                directory in which the current module is located) for an
  391.                include file, but you can enter alternate path names. For
  392.                example:
  393.  
  394.                     -ip c:\dos\;c:\prg\text\
  395.  
  396.                Each path name must be separate by a ";" and the -i command
  397.                must be followed by a "p" (if you are not entering an
  398.                alternate path name, then do not include the "p").
  399.  
  400.           309  The -n command.
  401.  
  402.                C xref automatically cross-references include files enclosed
  403.                in double quotes (i.e. #include "mydef.h"), but you can
  404.                disable this with the 'n' command. C xref searches the
  405.                current directory for the include file, but if it is
  406.                unfound, and the '-i' command was entered, it will search
  407.                any alternate path names that follow it.
  408.  
  409.           Note: If you use identifiers in place of file names in your
  410.           include statements, then C xref can not cross-reference them. For
  411.           example:
  412.                #define F_NAME "mydef.h"
  413.                #include F_NAME          /* won't cross-reference! */
  414.  
  415.  
  416.  
  417.                   C xref - C language cross-reference utility. v2.0
  418.  
  419.  
  420.  
  421.           310  Command line examples.
  422.  
  423.                cxref -ip c:\dos\;c:\prg\text\ -w mod??.c
  424.  
  425.                This command line will:
  426.                o    Output a complete cross-reference listing.
  427.                o    Cross-reference all include files, looking for them in
  428.                     the default, "c:\dos\", and "c:\prg\text\" directories.
  429.                o    Output in 132 column width.
  430.                o    Cross-reference any file that matches the file name
  431.                     pattern "mod??.c".
  432.  
  433.                cxref -t -l c:\prg\*.c a:\text\bigprg?.*
  434.  
  435.                This command line will:
  436.                o    Only output a function tree.
  437.                o    Output the global and function identifiers and give you
  438.                     the opportunity to add them to the RES_WORD.TXT file.
  439.                o    Cross-reference all files in the sub-directories
  440.                     "c:\prg\*.c" and "a:\text\bigprg?.*" that match the
  441.                     name patterns "*.c" and "bigprg?.*".
  442.  
  443.           Note: if you run C xref with an empty command line (i.e. cxref
  444.           <CR>) you will get a short description of the command switches.
  445.  
  446.  
  447.  
  448.                   C xref - C language cross-reference utility. v2.0
  449.  
  450.  
  451.  
  452.           401  The reserved word file: RES_WORD.TXT
  453.  
  454.                If C xref included references to C function calls (printf,
  455.                etc.) or it's reserved words, the output would soon become
  456.                pretty long and messy.
  457.  
  458.                To prevent this, C xref reads the RES_WORD.TXT file when
  459.                executed, and ignores any words in your modules that match
  460.                those from the file.
  461.  
  462.                RES_WORD.TXT is an ASCII text file where each reserved word
  463.                is followed by a new line character.  The line length is
  464.                limited to 80 characters. Anything following an '*' in the
  465.                first column is considered a comment, and is ignored (the
  466.                '*' MUST be in the first column). The reserved word list is
  467.                stored by C xref in a binary tree, so the best efficiency (a
  468.                more balanced tree) is achieved when you do not build the
  469.                RES_WORD.TXT file in alphabetical order.
  470.  
  471.                The RES_WORD.TXT file included with this program has all of
  472.                C's reserved words and ANSI function calls, and a number of
  473.                common defines (e.g. TRUE, FALSE, EOF, etc.). The file also
  474.                includes the function calls from Turbo C (if you are using
  475.                another compiler you can simply delete these, and add the
  476.                function calls of your compiler).
  477.  
  478.                The RES_WORD.TXT file must be in the same directory as C
  479.                xref.
  480.  
  481.  
  482.           501  What C xref ignores.
  483.  
  484.                C xref ignores:
  485.  
  486.                o    Anything enclosed by single or double quotes.
  487.                o    All comments.
  488.                o    Anything that matches the contents of the RES_WORD.TXT
  489.                     file.
  490.  
  491.          ----------------end-of-author's-documentation---------------
  492.  
  493.                          Software Library Information:
  494.  
  495.                     This disk copy provided as a service of
  496.  
  497.                            Public (software) Library
  498.  
  499.          We are not the authors of this program, nor are we associated
  500.          with the author in any way other than as a distributor of the
  501.          program in accordance with the author's terms of distribution.
  502.  
  503.          Please direct shareware payments and specific questions about
  504.          this program to the author of the program, whose name appears
  505.          elsewhere in  this documentation. If you have trouble getting
  506.          in touch with the author,  we will do whatever we can to help
  507.          you with your questions. All programs have been tested and do
  508.          run.  To report problems,  please use the form that is in the
  509.          file PROBLEM.DOC on many of our disks or in other written for-
  510.          mat with screen printouts, if possible.  PsL cannot debug pro-
  511.          programs over the telephone, though we can answer questions.
  512.  
  513.          Disks in the PsL are updated  monthly,  so if you did not get
  514.          this disk directly from the PsL, you should be aware that the
  515.          files in this set may no longer be the current versions. Also,
  516.          if you got this disk from another vendor and are having prob-
  517.          lems,  be aware that  some files may have become corrupted or
  518.          lost by that vendor. Get a current, working disk from PsL.
  519.  
  520.          For a copy of the latest monthly software library newsletter
  521.          and a list of the 4,000+ disks in the library, call or write
  522.  
  523.                            Public (software) Library
  524.                                P.O.Box 35705 - F
  525.                             Houston, TX 77235-5705
  526.  
  527.                                 1-800-2424-PSL
  528.                              MC/Visa/AmEx/Discover
  529.  
  530.                           Outside of U.S. or in Texas
  531.                           or for general information,
  532.                               Call 1-713-524-6394
  533.  
  534.                           PsL also has an outstanding
  535.                           catalog for the Macintosh.
  536.  
  537.